﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;

namespace Cost.Models
{
    public partial class Privilege
    {
        /// <summary>
        /// 组织类型
        /// </summary>
        [NotMapped]
        [Display(Name = "权限类型")]
        public PrivilegeType? PrivilegeTypeEnum
        {
            get
            {
                if (!string.IsNullOrEmpty(PrivilegeType))
                {
                    return (PrivilegeType)Enum.Parse(typeof(PrivilegeType), PrivilegeType);
                }
                else
                {
                    return null;
                }
            }
            set
            {
                PrivilegeType = value.ToString();
            }
        }

        /// <summary>
        /// 父权限名称
        /// </summary>
        [NotMapped]
        [Display(Name = "父权限名称")]
        public string ParentName { get; set; }
    }
}
